package cn.yeziji.forum.basic.netty.chat;

import cn.yeziji.forum.basic.netty.user.UserMessage;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 聊天室信息
 *
 * @author gzkemays
 * @since 2022/11/10 11:13 AM
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ChatroomInfo {
  /** 聊天室名称 */
  String name;
  /** 聊天室的聊天记录 */
  List<ChatMessage> transcript;
  /** 聊天室里的用户 */
  List<UserMessage> userMessages;

  public ChatroomInfo(List<ChatMessage> transcript, List<UserMessage> userMessages) {
    this.transcript = transcript;
    this.userMessages = userMessages;
  }

  public static ChatroomInfo publicRoom(
      List<ChatMessage> transcript, List<UserMessage> userMessages) {
    return new ChatroomInfo("公共聊天室", transcript, userMessages);
  }
}
